package com.ccp.dev.qbdms.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.ccp.dev.core.basic.annotion.Action;
import com.ccp.dev.core.basic.consts.UrlConstants;
import com.ccp.dev.core.basic.internationalization.SysBaseController;
import com.ccp.dev.core.basic.response.ResultData;
import com.ccp.dev.core.basic.util.ContextUtil;
import com.ccp.dev.core.basic.web.query.QueryFilter;
import com.ccp.dev.core.poi.excel.reader.TableEntity;
import com.ccp.dev.core.util.RequestUtil;
import com.ccp.dev.core.util.StringUtil;
import com.ccp.dev.core.util.log.SysAuditThreadLocalHolder;
import com.ccp.dev.qbdms.consts.ZhiLiangConst;
import com.ccp.dev.qbdms.expimp.CustomExcelReader;
import com.ccp.dev.qbdms.expimp.util.AbstractExpUtil;
import com.ccp.dev.qbdms.expimp.util.AbstractImpUtil;
import com.ccp.dev.qbdms.expimp.util.AuxiliaryUtil;
import com.ccp.dev.qbdms.model.WQbdChemicalPhysicsInfo;
import com.ccp.dev.qbdms.service.WCustomColumnsService;
import com.ccp.dev.qbdms.service.WQbdChemicalPhysicsInfoService;
import com.ccp.dev.qbdms.util.BaseUtil;
import com.ccp.dev.qbdms.util.ProjectUUIDUtils;
import com.ccp.dev.qbdms.util.StructureModifyUtil;
import com.ccp.dev.system.model.Dictionary;
import com.ccp.dev.system.service.DictionaryService;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

/**
 * 化学压力电源 信息操作处理控制器
 *
 * @author milihao
 * @date 2020-07-07 10:13:09
 */
@Controller
/**
 * 请将此名称添加到日志开关
 */
@Action(customModel = "化学压力电源")
@RequestMapping("/qbdms/wQbdChemicalPhysicsInfo")
public class WQbdChemicalPhysicsInfoController extends SysBaseController {

	@Resource
	private WQbdChemicalPhysicsInfoService wQbdChemicalPhysicsInfoService;
	@Resource
	private DictionaryService dictionaryService;
	@Resource
	private WCustomColumnsService wCustomColumnsService;

	private static String primaryPowerSystem = "（星船站空间工程型号）一次电源系统";
	private static String underwaterWeaponPowerSupply = "水中兵器电源";
	private static String powerSupplyForProjectiles = "弹箭用电源";

	/**
	 * 功能描述: 跳转到首页
	 *
	 * @return: java.lang.String
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + UrlConstants.MODULE_FUNCTION_LIST)
	@Action(description = "跳转到化学压力电源首页", exectype = "页面跳转日志")
	public String viewList(ModelMap modelMap, HttpServletRequest request) {
		modelMap.put("userId", ContextUtil.getCurrentUserId());
		modelMap.put("currentSystemLevel", BaseUtil.getCurrentSystemLevel());
		modelMap.addAttribute("typeList",
				JSON.toJSONString(wQbdChemicalPhysicsInfoService.getSelectData("", "", "")));
		modelMap.addAttribute("productNameList",
				JSON.toJSONString(dictionaryService.getByNodeKey("qttzdycpmc")));
		wCustomColumnsService.addCustomCols(request);
		return "wQbdChemicalPhysicsInfo/list";
	}

	/**
	 * 功能描述: 附带检索条件的分页查询
	 *
	 * @param: [request] http请求
	 * @return: java.lang.Object
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@RequestMapping(UrlConstants.MODULE_FUNCTION_LIST)
	@ResponseBody
	@Action(description = "附带检索条件的分页查询化学压力电源", detail = "查询数据信息<#if success>成功<#else></#if>")
	public Object list(HttpServletRequest request) {
		QueryFilter queryFilter = new QueryFilter(request, true);
		ZhiLiangConst.addQueryFilter(queryFilter);
		//分页数据
		List<WQbdChemicalPhysicsInfo> pageDatas = wQbdChemicalPhysicsInfoService.queryList(queryFilter);
		for (WQbdChemicalPhysicsInfo pageData : pageDatas) {
			try {
				pageData.setReportStatusStr(ZhiLiangConst.getStatusStrByInt(pageData.getReportStatus()));
			} catch (IllegalAccessException e) {
				e.printStackTrace();
			}
		}
		try {
			ZhiLiangConst.showName(pageDatas);
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		ZhiLiangConst.isDataAllowEdit(pageDatas, false);
		SysAuditThreadLocalHolder.putParamerter("success", true);
		return success(pageDatas, queryFilter.getPageBean().getTotalCount());
	}

	/**
	 * 功能描述: 上报列表
	 *
	 * @param: [request] http请求
	 * @return: java.lang.Object
	 * @auther: milihao
	 * @date: 2020-07-06 09:24:07
	 */
	@RequestMapping("/reportList")
	@ResponseBody
	@Action(description = "附带检索条件的分页查询化学电源(上报)", detail = "查询数据信息<#if success>成功<#else></#if>")
	public Object reportList(HttpServletRequest request, @RequestParam("id") String id,
			@RequestParam("tableName") String tableName) {
		List<WQbdChemicalPhysicsInfo> wQbdChemicalPhysicsInfoList = wQbdChemicalPhysicsInfoService
				.reportList(id, tableName);
		SysAuditThreadLocalHolder.putParamerter("success", true);
		return getResultDataSuccess("options.success", wQbdChemicalPhysicsInfoList);

	}

	/**
	 * 功能描述: 跳转到新增页面
	 *
	 * @return: java.lang.String
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + UrlConstants.MODULE_FUNCTION_ADD_UPDATE)
	@Action(description = "跳转到化学压力电源新增页面", exectype = "页面跳转日志")
	public String viewAdd(HttpServletRequest request, ModelMap modelMap) {
		String id = RequestUtil.getString(request, "id");
		String typeValue = RequestUtil.getString(request, "typeValue");
		modelMap.put("id", id);
		if (StringUtils.isNotBlank(id)) {
			WQbdChemicalPhysicsInfo wQbdChemicalPhysicsInfo = wQbdChemicalPhysicsInfoService
					.getOneById(id);
			typeValue = wQbdChemicalPhysicsInfo.getType();
			modelMap.put("productNameList", JSON.toJSONString(
					wQbdChemicalPhysicsInfoService.getSelectData(typeValue, typeValue + "所属产品类别",
							wQbdChemicalPhysicsInfo.getProductCategory())));
		}
		modelMap.put("type", typeValue);
		modelMap.put("typeList",
				JSON.toJSONString(wQbdChemicalPhysicsInfoService.getSelectData("", "", "")));
		modelMap.put("productCategoryList", JSON.toJSONString(
				wQbdChemicalPhysicsInfoService.getSelectData(typeValue, typeValue + "所属产品类别", "")));
		modelMap.put("stageList", JSON.toJSONString(
				wQbdChemicalPhysicsInfoService.getSelectData(typeValue, typeValue + "阶段", "")));
		if (typeValue.equals(primaryPowerSystem)) {
			return "wQbdChemicalPhysicsInfo/primaryPowerSystemAdd";
		} else if (typeValue.equals(underwaterWeaponPowerSupply)) {
			return "wQbdChemicalPhysicsInfo/underwaterWeaponPowerSupplyAdd";
		} else if (typeValue.equals(powerSupplyForProjectiles)) {
			return "wQbdChemicalPhysicsInfo/powerSupplyForProjectilesAdd";
		}
		return "wQbdChemicalPhysicsInfo/otherSpecialPowerSuppliesAdd";
	}

	/**
	 * 功能描述:  数据保存通用方法
	 *
	 * @param: wQbdChemicalPhysicsInfo 保存的对象
	 * @return: java.lang.Object
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@RequestMapping(UrlConstants.MODULE_FUNCTION_SAVE)
	@ResponseBody
	@Action(description = "保存化学压力电源数据", detail = "<#if isAdd>新增<#else>编辑</#if>化学压力电源数据<#if success>成功<#else>失败</#if><#if StringUtil.isNotEmpty(modifyInfo)>${modifyInfo}</#if>")
	public Object save(@RequestBody WQbdChemicalPhysicsInfo wQbdChemicalPhysicsInfo) {
		String id = wQbdChemicalPhysicsInfo.getId();
		int result;
		if (StringUtil.isEmpty(id)) {
			SysAuditThreadLocalHolder.putParamerter("isAdd", true);
			//新增操作
			//新增数据前生成随机Id
			wQbdChemicalPhysicsInfo.setId(ProjectUUIDUtils.getUUIDFor32());
			ZhiLiangConst.addCommonFields(wQbdChemicalPhysicsInfo);
			wQbdChemicalPhysicsInfo.setReportStatus(ZhiLiangConst.getDataInitStatusToHospital());
			result = wQbdChemicalPhysicsInfoService.add(wQbdChemicalPhysicsInfo);
		} else {
			SysAuditThreadLocalHolder.putParamerter("success", false);
			//修改操作
			WQbdChemicalPhysicsInfo oldWQbdChemicalPhysicsInfo = wQbdChemicalPhysicsInfoService.getOneById(id);
			String modifyInfo = StructureModifyUtil.getModifyInfo(oldWQbdChemicalPhysicsInfo, wQbdChemicalPhysicsInfo);
			SysAuditThreadLocalHolder.putParamerter("modifyInfo",modifyInfo);
			ZhiLiangConst.updateCommonFields(wQbdChemicalPhysicsInfo);
			result = wQbdChemicalPhysicsInfoService.update(wQbdChemicalPhysicsInfo);
		}
		if (result > 0) {
			SysAuditThreadLocalHolder.putParamerter("success", true);
		} else {
			SysAuditThreadLocalHolder.putParamerter("success", false);
		}
		return result > 0 ? getResultDataSuccess("save.success") : getResultDataError("save.failure");
	}

	/**
	 * 功能描述: 跳转到详情页面
	 *
	 * @return: java.lang.String
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + "/particulars")
	@Action(description = "跳转到化学压力电源详情页面", exectype = "页面跳转日志")
	public String viewParticulars(HttpServletRequest request, ModelMap modelMap) {
		String id = RequestUtil.getString(request, "id");
		String typeValue = RequestUtil.getString(request, "typeValue");
		modelMap.put("id", id);
		if (StringUtils.isNotBlank(id)) {
			WQbdChemicalPhysicsInfo wQbdChemicalPhysicsInfo = wQbdChemicalPhysicsInfoService
					.getOneById(id);
			typeValue = wQbdChemicalPhysicsInfo.getType();
			modelMap.put("productNameList", JSON.toJSONString(
					wQbdChemicalPhysicsInfoService.getSelectData(typeValue, typeValue + "所属产品类别",
							wQbdChemicalPhysicsInfo.getProductCategory())));
		}
		modelMap.put("type", typeValue);
		modelMap.put("typeList",
				JSON.toJSONString(wQbdChemicalPhysicsInfoService.getSelectData("", "", "")));
		modelMap.put("productCategoryList", JSON.toJSONString(
				wQbdChemicalPhysicsInfoService.getSelectData(typeValue, typeValue + "所属产品类别", "")));
		modelMap.put("stageList", JSON.toJSONString(
				wQbdChemicalPhysicsInfoService.getSelectData(typeValue, typeValue + "阶段", "")));
		String isClose = RequestUtil.getString(request, "isClose");
		modelMap.put("isClose", isClose);
		if (typeValue.equals(primaryPowerSystem)) {
			return "wQbdChemicalPhysicsInfo/primaryPowerSystemParticular";
		} else if (typeValue.equals(underwaterWeaponPowerSupply)) {
			return "wQbdChemicalPhysicsInfo/underwaterWeaponPowerSupplyParticular";
		} else if (typeValue.equals(powerSupplyForProjectiles)) {
			return "wQbdChemicalPhysicsInfo/powerSupplyForProjectilesParticular";
		}
		return "wQbdChemicalPhysicsInfo/otherSpecialPowerSuppliesParticular";
	}

	/**
	 * 功能描述: 根据主键id获取一条数据的通用查询方法
	 *
	 * @param: id 参数对象必须是"id"
	 * @return: java.lang.Object
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@RequestMapping(UrlConstants.MODULE_FUNCTION_GET)
	@ResponseBody
	@Action(description = "根据主键id查询化学压力电源的一条数据", detail = "根据主键id查询化学压力电源的数据<#if success>成功<#else>失败</#if>")
	public Object get(@RequestParam("id") String id) {
		WQbdChemicalPhysicsInfo wQbdChemicalPhysicsInfo = wQbdChemicalPhysicsInfoService.getOneById(id);
		if (null == wQbdChemicalPhysicsInfo) {
			SysAuditThreadLocalHolder.putParamerter("success", false);
			return getResultDataError("get.failure");
		}
		SysAuditThreadLocalHolder.putParamerter("success", true);
		return JSON.toJSONStringWithDateFormat(getResultDataSuccess("get.success", wQbdChemicalPhysicsInfo),"yyyy-MM-dd");
	}

	/**
	 * 功能描述: 根据主键ID删除数据的通用删除方法
	 *
	 * @param: id 参数名称必须是"id"
	 * @return: java.lang.Object
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@PostMapping(UrlConstants.MODULE_FUNCTION_DELETE)
	@ResponseBody
	@Action(description = "根据主键ID删除化学压力电源数据", exectype = "删除日志", detail = "删除数据信息<#if success>成功<#else>失败</#if>")
	public Object delete(@RequestParam("id") String id) {
		if (StringUtil.isEmpty(id)) {
			SysAuditThreadLocalHolder.putParamerter("success", false);
			return fail("delete.failure.message");
		}
		String userId = ContextUtil.getCurrentUserId();
		String[] ids = id.split(",");
		for (String key : ids) {
			WQbdChemicalPhysicsInfo data = wQbdChemicalPhysicsInfoService.getOneById(key);
			if (Objects.nonNull(data.getReportStatus()) && !ZhiLiangConst.REPORT_STATUS_TEMP_TOBEREPORTED
					.equals(data.getReportStatus()) && !ZhiLiangConst.REPORT_STATUS_GROUPTOBEREPORTED
					.equals(data.getReportStatus())) {
				SysAuditThreadLocalHolder.putParamerter("success", false);
				return fail("删除失败，只允许删除待上报和待报集团的数据");
			}
			if (!userId.equals(data.getCreateBy())) {
				SysAuditThreadLocalHolder.putParamerter("success", false);
				return fail("删除失败，只能删除自己创建的数据！");
			}
		}
		int result = wQbdChemicalPhysicsInfoService.delByIdArray(id.split(","));
		if (result > 0) {
			SysAuditThreadLocalHolder.putParamerter("success", true);
		} else {
			SysAuditThreadLocalHolder.putParamerter("success", false);
		}
		return result > 0 ? getResultDataSuccess("delete.success")
				: getResultDataError("delete.failure");
	}

	/**
	 * 功能描述: 跳转到导入页面
	 *
	 * @return: java.lang.String
	 * @auther: hw
	 * @date: 2019-12-25 19:21:40
	 */
	@RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + "/import")
	@Action(description = "跳转到化学压力电源导入页面", exectype = "页面跳转日志")
	public String viewImport() {
		return "wQbdChemicalPhysicsInfo/import";
	}

	/**
	 * 功能描述: 跳转到导出选择字段页面importData
	 */
	@RequestMapping(UrlConstants.VIEW_DISPATCH_PREFIX + "/export")
	@Action(description = "跳转到化学压力电源导出选择字段页面", exectype = "页面跳转日志")
	public String export(HttpServletRequest request, ModelMap modelMap) throws Exception {
		com.alibaba.fastjson.JSONObject jsonObject = AuxiliaryUtil.resolverModel(WQbdChemicalPhysicsInfo.class);
		modelMap.put("tableInfo", jsonObject.toString());
		return "expImp/add";
	}

	/**
	 * 功能描述: 导出飞化学压力电源数据信息
	 *
	 * @param: [request] http请求
	 * @return: java.lang.Object
	 * @auther: hjx
	 * @date: 2020-05-07 15:28:26
	 */
	@RequestMapping("/exportData")
	@Action(description = "导出化学压力电源数据信息", detail = "导出化学压力电源数据信息<#if success>成功<#else></#if>")
	public void export(HttpServletRequest request, HttpServletResponse response) throws Exception {
		SysAuditThreadLocalHolder.putParamerter("success", false);
		String[] id = RequestUtil.getStringAryByStr(request, "id");
		QueryFilter queryFilter = new QueryFilter(request, false);
		JSONArray dataArray = ZhiLiangConst.exportAddConditions(queryFilter, id);
		List<WQbdChemicalPhysicsInfo> wQbdChemicalPhysicsInfos = this.wQbdChemicalPhysicsInfoService
				.queryAll(queryFilter);
		if (wQbdChemicalPhysicsInfos.isEmpty()) {
			wQbdChemicalPhysicsInfos.add(new WQbdChemicalPhysicsInfo());
		}
		new AbstractExpUtil() {
			@Override
			public String customAnalysis(String fieldName, String fieldValue) {
				return null;
			}
		}.executeExport(request, response, wQbdChemicalPhysicsInfos, dataArray,
				AbstractExpUtil.ExpStyle.MANY_SHEET);
		SysAuditThreadLocalHolder.putParamerter("success", true);
	}

	/**
	 * 导入资源文件
	 */
	@RequestMapping("/importData")
	@ResponseBody
	public ResultData importData(MultipartHttpServletRequest request, HttpServletResponse response)
			throws Exception {
		SysAuditThreadLocalHolder.putParamerter("success", false);
		MultipartFile multipartFile = request.getFile("file");
		TableEntity excelEntity = new CustomExcelReader().readFile(multipartFile.getInputStream());
		List<Dictionary> zlList = dictionaryService.getByNodeKey("zl");
		List<Dictionary> scjdList = dictionaryService.getByNodeKey("scjd");
		List<Dictionary> wtyyList = dictionaryService.getByNodeKey("wtyy");
		List<Dictionary> qttzdycpmcList = dictionaryService.getByNodeKey("qttzdycpmc");
		List<Dictionary> sfhgList = dictionaryService.getByNodeKey("sfhg");
		List<Dictionary> bmzjszbList = dictionaryService.getByNodeKey("bmzjszb");
		Map<String, Object> map = new AbstractImpUtil() {
			@Override
			public ReturnType customValidation(String fieldName, String fieldValue) {
				ReturnType returnType = null;
				if ("type".equals(fieldName) || "productCategory".equals(fieldName) || "productName"
						.equals(fieldName) || "stage".equals(fieldName)) {
					returnType = new AbstractImpUtil.ReturnType();
					boolean sign = true;
					for (Dictionary dictionary : zlList) {
						if (dictionary.getItemName().equals(fieldValue)) {
							returnType.setNewValue(dictionary.getItemValue());
							sign = false;
							break;
						}
					}
					for (Dictionary dictionary : qttzdycpmcList) {
						if (dictionary.getItemName().equals(fieldValue)) {
							returnType.setNewValue(dictionary.getItemValue());
							sign = false;
							break;
						}
					}
					if (sign) {
						returnType.setMsg("非法的值!");
					}
				} else if ("deliveryQuantity".equals(fieldName)) {
					returnType = new AbstractImpUtil.ReturnType();
					boolean sign = true;
					try {
						Integer.parseInt(fieldValue.replace(",",""));
						returnType.setNewValue(fieldValue.replace(",",""));
						sign = false;
					} catch (Throwable t) {
					}
					if (sign) {
						returnType.setMsg("非法的值!");
					}
				} else if ("atTheStage".equals(fieldName)) {
					returnType = new AbstractImpUtil.ReturnType();
					boolean sign = true;
					for (Dictionary dictionary : scjdList) {
						if (dictionary.getItemName().equals(fieldValue)) {
							returnType.setNewValue(dictionary.getItemValue());
							sign = false;
							break;
						}
					}
					if (sign) {
						returnType.setMsg("非法的值!");
					}
				} else if ("problemCauses".equals(fieldName)) {
					returnType = new AbstractImpUtil.ReturnType();
					boolean sign = true;
					for (Dictionary dictionary : wtyyList) {
						if (dictionary.getItemName().equals(fieldValue)) {
							returnType.setNewValue(dictionary.getItemValue());
							sign = false;
							break;
						}
					}
					if (sign) {
						returnType.setMsg("非法的值!");
					}
				} else if ("isQualified".equals(fieldName)) {
					returnType = new AbstractImpUtil.ReturnType();
					boolean sign = true;
					for (Dictionary dictionary : sfhgList) {
						if (dictionary.getItemName().equals(fieldValue)) {
							returnType.setNewValue(dictionary.getItemValue());
							sign = false;
							break;
						}
					}
					if (sign) {
						returnType.setMsg("非法的值!");
					}
				} else if ("notMeetSpecifications".equals(fieldName)) {
					returnType = new AbstractImpUtil.ReturnType();
					boolean sign = true;
					for (Dictionary dictionary : bmzjszbList) {
						if (dictionary.getItemName().equals(fieldValue)) {
							returnType.setNewValue(dictionary.getItemValue());
							sign = false;
							break;
						}
					}
					if (sign) {
						returnType.setMsg("非法的值!");
					}
				}
				return returnType;
			}
		}.reverseModels(excelEntity, WQbdChemicalPhysicsInfo.class);
		String msg = map.get("msg").toString();
		List<WQbdChemicalPhysicsInfo> list = (List<WQbdChemicalPhysicsInfo>) map.get("instList");
		if (StringUtil.isEmpty(msg)) {
			this.wQbdChemicalPhysicsInfoService.addImportData(list);
			SysAuditThreadLocalHolder.putParamerter("success", true);
			return getResultDataSuccess("dataSource.importXml.success");
		} else {
			SysAuditThreadLocalHolder.putParamerter("success", false);
			return fail(msg);
		}
	}


	/**
	 * 功能描述: 跳转到首页
	 *
	 * @return: java.lang.String
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@RequestMapping("/view/selectType")
	@Action(description = "跳转到选择分类页面", exectype = "页面跳转日志")
	public Object selectType(Model model) {
		model.addAttribute("typeList",
				JSON.toJSONString(wQbdChemicalPhysicsInfoService.getSelectData("", "", "")));
		return "wQbdChemicalPhysicsInfo/selectType";
	}

	/**
	 * 功能描述: 获取字典
	 *
	 * @return: java.lang.String
	 * @auther: milihao
	 * @date: 2020-07-07 10:13:09
	 */
	@RequestMapping("/getSelectData")
	@ResponseBody
	@Action(description = "获取字典", exectype = "页面跳转日志")
	public Object getSelectData(String typeValue, String productCategoryValue) {
		if (StringUtils.isNotBlank((productCategoryValue)) && "1".equals(productCategoryValue)) {
			return JSON.toJSONString(
					wQbdChemicalPhysicsInfoService
							.getSelectData(typeValue, typeValue + "阶段", productCategoryValue));
		}
		return JSON.toJSONString(
				wQbdChemicalPhysicsInfoService
						.getSelectData(typeValue, typeValue + "所属产品类别", productCategoryValue));

	}
}
